// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';

/**
 * 订单管理
 */
// 交易订单
import Order from '@/views/pay/Order';
// 图表界面
import statistics from '@/views/charts/statistics';

//店铺管理
import Seller from '@/views/seller/Seller'

// 商品类型管理
import GoodsType from '@/views/product/GoodsType';
// 商品管理
import Goods from '@/views/product/Goods';
// 评论管理
import Comments from '@/views/comment/Comments';
import VueRouter from 'vue-router';
// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [{
            path: '/seller/Seller',
            name: '店铺管理',
            component: Seller,
            meta: {
                requireAuth: true
            }
        },
        {
            path: '/product/GoodsType',
            name: '商品类型管理',
            component: GoodsType,
            meta: {
                requireAuth: true
            }
        }
        ,{
            path: '/product/Goods',
            name: '商品管理',
            component: Goods,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/pay/Order',
            name: '交易订单',
            component: Order,
            meta: {
                requireAuth: true
            }
        },{
            path: '/comment/Comments',
            name: '评论管理',
            component: Comments,
            meta: {
                requireAuth: true
            }
        },{
            path: '/charts/statistics',
            name: '销量查询',
            component: statistics,
            meta: {
                requireAuth: true
            }
        }]
    }]
})